/*
 * lookups.h
 *
 *  Created on: 27 Aug 2023
 *      Author: User
 */

#ifndef USER_LOOKUPS_H_
#define USER_LOOKUPS_H_

// Define an array as a look up table for dimming to a sine pattern
u8 sine_lookup[256] = {
    0, 0, 1, 1, 2, 2, 3, 4, 6, 8, 11, 13, 15, 17, 20, 22, 25, 28, 31, 34,
    37, 40, 43, 46, 49, 53, 56, 60, 64, 67, 71, 75, 79, 83, 87, 91, 95, 99,
    103, 107, 111, 115, 119, 123, 126, 130, 133, 137, 140, 143, 146, 150, 153,
    156, 159, 162, 165, 168, 171, 174, 177, 180, 182, 185, 188, 190, 193, 195,
    198, 200, 202, 204, 206, 208, 210, 212, 214, 216, 217, 219, 220, 222, 223,
    224, 226, 227, 228, 229, 230, 231, 232, 233, 233, 234, 235, 235, 236, 236,
    237, 237, 237, 237, 237, 238, 238, 238, 238, 238, 238, 238, 238, 239, 239,
    239, 239, 239, 239, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240,
    240, 239, 239, 239, 239, 239, 239, 238, 238, 238, 238, 238, 238, 238, 238,
    238, 237, 237, 237, 237, 237, 236, 236, 235, 235, 234, 233, 233, 232, 231,
    230, 229, 228, 227, 226, 224, 223, 222, 220, 219, 217, 216, 214, 212, 210,
    208, 206, 204, 202, 200, 198, 195, 193, 190, 188, 185, 182, 180, 177, 174,
    171, 168, 165, 162, 159, 156, 153, 150, 146, 143, 140, 137, 133, 130, 126,
    123, 119, 115, 111, 107, 103, 99, 95, 91, 87, 83, 79, 75, 71, 67, 64, 60,
    56, 53, 49, 46, 43, 40, 37, 34, 31, 28, 25, 22, 20, 17, 15, 13, 11, 8, 6,
    4, 3, 2, 2, 1, 1, 0, 0
};

// "Sine" Wave lookup table
const u8 sine_lookup_2[256] = {
      0, 5, 6, 7, 8, 9,
      12, 15, 18, 20, 23, 26, 29, 31,
      34, 37, 40, 43, 45, 48, 51, 54,
      57, 60, 63, 66, 68, 71, 74, 77,
      80, 83, 86, 89, 91, 94, 97, 100,
      103, 106, 109, 112, 115, 118, 121, 124,
      127, 130, 133, 136, 139, 142, 145, 148,
      151, 154, 157, 160, 163, 166, 169, 172,
      174, 177, 180, 183, 186, 189, 192, 195,
      197, 200, 203, 206, 209, 211, 214, 217,
      220, 222, 225, 228, 230, 233, 235, 238,
      240, 243, 245, 247, 250, 252, 254, 255,
      255, 255, 255, 255, 255, 254, 252, 250,
      247, 245, 243, 240, 238, 235, 233, 230,
      228, 225, 222, 220, 217, 214, 211, 209,
      206, 203, 200, 197, 195, 192, 189, 186,
      183, 180, 177, 174, 172, 169, 166, 163,
      160, 157, 154, 151, 148, 145, 142, 139,
      136, 133, 130, 127, 124, 121, 118, 115,
      112, 109, 106, 103, 100, 97, 94, 91,
      89, 86, 83, 80, 77, 74, 71, 68,
      66, 63, 60, 57, 54, 51, 48, 45,
      43, 40, 37, 34, 31, 29, 26, 23,
      20, 18, 15, 12,
      9, 6, 7, 6, 5, 0
};

//'Not-Random_at-All' lookup table weighted with 255 and 0
u8 rand_lookup_2[256] = {
  255, 63, 0, 255, 123, 0, 255, 170, 85, 255, 170, 170, 85, 170, 170, 85,
  191, 60, 226, 0, 65, 173, 154, 91, 67, 0, 205, 87, 53, 92, 194, 121,
  0, 0, 255, 0,0, 181, 255, 98, 54, 85, 123, 255, 255, 167, 0, 197,
  66, 102, 0, 75, 0, 87, 207, 144, 0, 98, 255, 0, 255, 0, 127, 56,
  0, 0, 239, 0, 170, 106, 177, 56, 107, 63, 0, 98, 228, 18, 50, 138,
  65, 79, 120, 231, 0, 70, 199, 115, 0, 0, 170, 85, 170, 255, 170, 60,
  129, 0, 85, 118, 85, 251, 85, 255, 32, 143, 168, 131, 129, 212, 87, 142,
  121, 255, 0, 0, 255, 61, 255, 255, 54, 97, 170, 0, 0, 219, 52, 255,
  255, 170, 0, 0, 0, 157, 90, 255, 255, 0, 30, 123, 63, 66, 198, 154,
  28, 236, 165, 64, 156, 0, 0, 126, 198, 146, 60, 117, 77, 80, 2, 16,
  73, 0, 0, 18, 34, 0, 60, 181, 119, 255, 0, 218, 255, 68, 235, 112,
  91, 48, 0, 255, 255, 139, 16, 76, 32, 89, 45, 13, 0, 32, 97, 234,
  78, 154, 45, 236, 142, 235, 73, 236, 226, 50, 167, 201, 93, 50, 181, 145,
  24, 3, 72, 52, 15, 44, 134, 0, 0, 255, 57, 255, 20, 255, 5, 0,
  26, 10, 0, 31, 219, 0, 0, 70, 71, 0, 31,
};

#endif /* USER_LOOKUPS_H_ */
